/**
  ******************************************************************************
  * @file    it.c 
  * @author  MCD Application Team
  * @brief   Main Interrupt Service Routines.
  *          This file provides template for all exceptions handler and 
  *          peripherals interrupt service routine.
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include "bsp.h"
#include "cpu_it.h"

/** @addtogroup 
  * @{
  */
cpu_it_type cpu_it;

/** @addtogroup GPIO_EXTI
  * @{
  */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/******************************************************************************/
/*            Cortex-M4 Processor Exceptions Handlers                         */
/******************************************************************************/

/**
  * @brief  This function handles NMI exception.
  * @param  None
  * @retval None
  */
void NMI_Handler(void)
{
}

/**
  * @brief  This function handles HardFault_Handler exception.
  * @param  None
  * @retval None
  */
void HardFault_Handler(void)
{
}

/**
  * @brief  This function handles Memory Manage exception.
  * @param  None
  * @retval None
  */
void MemManage_Handler(void)
{
  /* Go to infinite loop when Memory Manage exception occurs */
  while (1)
  {
  }
}

/**
  * @brief  This function handles Bus Fault exception.
  * @param  None
  * @retval None
  */
void BusFault_Handler(void)
{
  /* Go to infinite loop when Bus Fault exception occurs */
  while (1)
  {
  }
}

/**
  * @brief  This function handles Usage Fault exception.
  * @param  None
  * @retval None
  */
void UsageFault_Handler(void)
{
  /* Go to infinite loop when Usage Fault exception occurs */
  while (1)
  {
  }
}

/**
  * @brief  This function handles SVC_Handler exception.
  * @param  None
  * @retval None
  */
//void SVC_Handler(void)
//{
//}

/**
  * @brief  This function handles Debug Monitor exception.
  * @param  None
  * @retval None
  */
void DebugMon_Handler(void)
{
	
}

/**
  * @brief  This function handles USART0_IRQHandler exception.
  * @param  None
  * @retval None
  */
void UART0_IRQHandler(void)
{
	if(cpu_it.uart0)
		cpu_it.uart0();
}

/**
  * @brief  This function handles USART2_IRQHandler exception.
  * @param  None
  * @retval None
  */
void UART2_IRQHandler(void)
{
	if(cpu_it.uart2)
		cpu_it.uart2();
}


/**
  * @brief  This function handles UART4_IRQHandler exception.
  * @param  None
  * @retval None
  */
void UART4_IRQHandler(void)
{
	if(cpu_it.uart4)
		cpu_it.uart4();
}

